PROJECT(RenderPlugin)

SET( QT_USE_QTXML TRUE )
SET( QT_WRAP_CPP TRUE )
SET( CMAKE_INCLUDE_CURRENT_DIR ON )
SET( CMAKE_AUTOMOC ON )
SET( CMAKE_AUTORCC ON )
SET( CMAKE_AUTOUIC ON )
	
SET(RenderPlugin_SRCS
	RenderPlugin.cc
)

SET(RenderPlugin_MOC_HDRS
	RenderPlugin.h
	include/toolkit_interfaces.h
)

INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR}/vendor/QVideoWriter/include)

INCLUDE_DIRECTORIES (${QT_INCLUDE_DIR})
INCLUDE_DIRECTORIES (${RBDL_INCLUDE_DIR})
INCLUDE_DIRECTORIES (${EIGEN3_INCLUDE_DIR})

INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR})
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}/ui)
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}/include)

ADD_DEFINITIONS (${QT_DEFINITIONS})
ADD_DEFINITIONS (-DQT_PLUGIN)
ADD_DEFINITIONS (-DQT_SHARED)

ADD_SUBDIRECTORY (
	vendor/QVideoWriter/
)

INCLUDE_DIRECTORIES(${FFMPEG_INCLUDE_DIRS})

QT5_WRAP_UI ( RenderPlugin_UI_SRC
	ui/RenderImageDialog.ui	
	ui/RenderImageSeriesDialog.ui	
	ui/RenderVideoDialog.ui	
)

QT5_WRAP_CPP ( RenderPlugin_MOC_SRCS
	RenderImageDialog.h
	RenderImageSeriesDialog.h
	RenderVideoDialog.h
)

ADD_LIBRARY (renderplugin SHARED 
	${RenderPlugin_SRCS}
	${RenderPlugin_MOC_SRCS}
	${RenderPlugin_UI_SRC}
)

TARGET_LINK_LIBRARIES (renderplugin 
	${QT_LIBRARIES} 
	${QT_QTXML_LIBRARY} 
	Qt5::Core
	Qt5::Gui
	Qt5::Widgets
	Qt5::3DCore
	Qt5::3DExtras
	Qt5::3DRender
	Qt5::3DInput
	${RBDL_LIBRARY}
	qvideowriter
	toolkitlib
)

INSTALL( TARGETS renderplugin LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
